package com.cx.config;


import com.cx.interceptor.UserLoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
     * @description  拦截器配置类
     */
    @SpringBootConfiguration
    public class InterceptorConfig extends WebMvcConfigurerAdapter {
        @Autowired
        UserLoginInterceptor userLoginInterceptor;

        @Override
        public void addInterceptors(InterceptorRegistry registry) {
            System.out.println("拦截器配置");
        registry.addInterceptor(userLoginInterceptor).addPathPatterns("**/personalcenter/html/*.do");
//            registry.addInterceptor(webInterceptor).addPathPatterns("/**/task");
//            registry.addInterceptor(webInterceptor).addPathPatterns("/**/ryclxx");
//            registry.addInterceptor(webInterceptor).addPathPatterns("/**/xzyh");
//            registry.addInterceptor(webInterceptor).addPathPatterns("/**/news");
//            super.addInterceptors(registry);
        }
    }

